package java04;

import java.util.Objects;

//酒店房间
public class Room {
    private int no;//房间编号
    private String type;//房间类型
    private boolean status;//房间状态

    public Room() {
    }

    public Room(int no, String type, boolean status) {
        this.no = no;
        this.type = type;
        this.status = status;
    }

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Room room = (Room) o;
        return no == room.getNo();
    }

    @Override
    public String toString() {
        return "["+ no +"," + type + "," + (status ? "空闲":"占用") +"]";
    }
}
